package com.cn;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.remoting.caucho.HessianServiceExporter;

import com.cn.sys.service.ScheduleJobLogService;
import com.cn.sys.service.ScheduleJobService;


/**
 * Hello world!
 *
 */
@SpringBootApplication
@MapperScan("com.cn.dao")
public class App 
{
    public static void main( String[] args )
    {
    	SpringApplication.run(App.class, args);
    }
    
    @Autowired
    private ScheduleJobLogService jobLogService;
    
    @Autowired
    private ScheduleJobService jobService;
    
    
	@Bean(name = "/ScheduleJobLogService")
	public HessianServiceExporter scheduleJobLogService() {
		HessianServiceExporter exporter = new HessianServiceExporter();
		exporter.setService(jobLogService);
		exporter.setServiceInterface(ScheduleJobLogService.class);
		return exporter;
	}
	
    
	@Bean(name = "/ScheduleJobService")
	public HessianServiceExporter scheduleJobService() {
		HessianServiceExporter exporter = new HessianServiceExporter();
		exporter.setService(jobService);
		exporter.setServiceInterface(ScheduleJobService.class);
		return exporter;
	}
}
